﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace XPathAutoSuggest {
    /// <summary>
    /// Simple class holding a pair of strings representing a query and description
    /// </summary>
    /// <remarks>
    /// Makes it easier to display query/description pairs in a grid.
    /// 
    /// INotifyPropertyChanged forces Windows to display updates.
    /// </remarks>
    public class QueryDescPair : INotifyPropertyChanged {
        private string _Query;
        private string _Description;

        /// <summary>
        /// Gets/sets the query 
        /// </summary>
        public string Query {
            get { return _Query; }
            set {
                _Query = value;
                if (PropertyChanged != null) {
                    PropertyChanged(this, new PropertyChangedEventArgs("Query"));
                }
            }
        }

        /// <summary>
        /// Get/sets the description of the query
        /// </summary>
        public string Description {
            get { return _Description; }
            set {
                _Description = value;
                if (PropertyChanged != null) {
                    PropertyChanged(this, new PropertyChangedEventArgs("Description"));
                }
            }
        }

        #region INotifyPropertyChanged Members
        /// <summary>An event which is raised when a member value has been changed</summary>
        public event PropertyChangedEventHandler PropertyChanged;
        #endregion
    }
}
